<?php

namespace App\Support;

use App\Services\AgentService;

class TableAqViewComponents
{
	public static function make()
	{
		return new self();
	}

	public function rowShowButton(){
		return amis()
			->DrawerAction()
			->label('查看')
			->level('link')
			->drawer(
				amis()
					->Drawer()
					->actions([])
					->title('查看详情')
					->size('lg')
					->closeOnOutside()
					->closeOnEsc()
					->body([
						amis()->RatingControl()->name('rating')->readOnly('1')->value('${score}')->mode('horizontal'),
						amis()->Tag()->label('${request_data.model}')->color('#3b75fd')->displayMode('status'),
						amis()->Tpl()->tpl('${request_id}')->inline('1'),
						amis()->Tpl()->tpl('${created_at}')->inline('1'),
						amis()->Divider()->lineStyle('dashed')->direction('horizontal')->rotate('0'),
						amis()->Html()->label('文档')->tpl('<a href="${docs.filepath}">${docs.filename}</a>'),
						amis()->Images()->label('图片')->displayMode('thumb')->source('${images}')->enlargeAble('1'),
						amis()->TextControl('request_text')->static(),
						amis()->Divider()->lineStyle('solid')->direction('horizontal')->rotate('0')->color('#98ace8')->style([
							'borderWidth' => '4px',
						]),
						amis()->Markdown()->value('${response_text}')->static(),
					])
			);
	}
}
